<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>UUID Encoding / Decoding</title>
<link href="tabs.css" rel="stylesheet" type="text/css" />
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="alias.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="alias.js"></script>

<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>


<script type="text/javascript">
  jQuery(document).ready(function () {
    if(gref){ // Number all _img and _table classes
      gref();
    }
  });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->

<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">nRF51822 BLE SDK
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('group__ble__sdk__lib__uuid.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">UUID Encoding / Decoding</div>  </div>
<div class="ingroups"><a class="el" href="group__ble__sdk__lib.html">Bluetooth Libraries</a></div></div>
<div class="contents">

<p>Functions for encoding and decoding UUIDs.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__lib__uuid.html#ga5d4dd4f63e0bbe18837f9dfab4c0c15d">ble_uuid_set_base</a> (uint16_t base_uuid128_count, const <a class="el" href="structble__uuid128__t.html">ble_uuid128_t</a> *p_base_uuid128)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialise the UUID module 128-bit base list.  <a href="#ga5d4dd4f63e0bbe18837f9dfab4c0c15d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__lib__uuid.html#ga882bee030ada24a6ade6521b62f42131">ble_uuid_decode</a> (uint8_t uuid_len, const uint8_t *p_encoded, <a class="el" href="structble__uuid__t.html">ble_uuid_t</a> *p_uuid)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Decode the UUID bytes (16-bit or 128-bit) in Little-Endian to uuid_t structure.  <a href="#ga882bee030ada24a6ade6521b62f42131"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__lib__uuid.html#ga8af3492a4ce7d3db30915dbcbd8e83b9">ble_uuid_encode</a> (const <a class="el" href="structble__uuid__t.html">ble_uuid_t</a> *p_uuid, uint8_t *p_uuid_len, uint8_t *p_encoded)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Encode the uuid_t structure into Little-Endian UUID bytes (16-bit or 128-bit).  <a href="#ga8af3492a4ce7d3db30915dbcbd8e83b9"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<p>Functions for encoding and decoding UUIDs. </p>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga5d4dd4f63e0bbe18837f9dfab4c0c15d"></a><!-- doxytag: member="ble_uuid_util.h::ble_uuid_set_base" ref="ga5d4dd4f63e0bbe18837f9dfab4c0c15d" args="(uint16_t base_uuid128_count, const ble_uuid128_t *p_base_uuid128)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ble_uuid_set_base </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>base_uuid128_count</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structble__uuid128__t.html">ble_uuid128_t</a> *&#160;</td>
          <td class="paramname"><em>p_base_uuid128</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initialise the UUID module 128-bit base list. </p>
<p>This function is used to replace the default UUID base lookup table. The first 128-bit (16-bytes) shall be the BT SIG Base, and the following 128-bit entries can be vendor specific. All entries in this table shall be in little-endian.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">base_uuid128_count</td><td>Number of elements in the Base lookup table. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">p_base_uuid128</td><td>Pointer to new Base Lookup Table.</td></tr>
  </table>
  </dd>
</dl>
<dl class="note"><dt><b>Note:</b></dt><dd>First 16 bytes shall be BT SIG base. If this interface is not called, a default look up table with BT SIG will be used. </dd></dl>

<p>Definition at line <a class="el" href="ble__uuid__util_8c_source.html#l00040">40</a> of file <a class="el" href="ble__uuid__util_8c_source.html">ble_uuid_util.c</a>.</p>

</div>
</div>
<a class="anchor" id="ga882bee030ada24a6ade6521b62f42131"></a><!-- doxytag: member="ble_uuid_util.h::ble_uuid_decode" ref="ga882bee030ada24a6ade6521b62f42131" args="(uint8_t uuid_len, const uint8_t *p_encoded, ble_uuid_t *p_uuid)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t ble_uuid_decode </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>uuid_len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>p_encoded</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structble__uuid__t.html">ble_uuid_t</a> *&#160;</td>
          <td class="paramname"><em>p_uuid</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Decode the UUID bytes (16-bit or 128-bit) in Little-Endian to uuid_t structure. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">uuid_len</td><td>Length in bytes of the uuid to be decoded (2 or 16 bytes). </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">p_encoded</td><td>Pointer pointing to LE UUID bytes. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">p_uuid</td><td>Pointer to <a class="el" href="structble__uuid__t.html" title="Bluetooth Low Energy UUID type, encapsulates both 16-bit and 128-bit UUIDs.">ble_uuid_t</a> structure which shall be filled.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>NRF_SUCCESS on successful read of the report, otherwise an error code. </dd></dl>

<p>Definition at line <a class="el" href="ble__uuid__util_8c_source.html#l00047">47</a> of file <a class="el" href="ble__uuid__util_8c_source.html">ble_uuid_util.c</a>.</p>

</div>
</div>
<a class="anchor" id="ga8af3492a4ce7d3db30915dbcbd8e83b9"></a><!-- doxytag: member="ble_uuid_util.h::ble_uuid_encode" ref="ga8af3492a4ce7d3db30915dbcbd8e83b9" args="(const ble_uuid_t *p_uuid, uint8_t *p_uuid_len, uint8_t *p_encoded)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t ble_uuid_encode </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structble__uuid__t.html">ble_uuid_t</a> *&#160;</td>
          <td class="paramname"><em>p_uuid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>p_uuid_len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>p_encoded</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Encode the uuid_t structure into Little-Endian UUID bytes (16-bit or 128-bit). </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">p_uuid</td><td>Pointer to <a class="el" href="structble__uuid__t.html" title="Bluetooth Low Energy UUID type, encapsulates both 16-bit and 128-bit UUIDs.">ble_uuid_t</a> structure that shall be encoded. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">p_uuid_len</td><td>Pointer to length of encoded data. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">p_encoded</td><td>Pointer to buffer that shall be filled with little-endian 16 or 128 bit uuid. If p_encoded is NULL, this function will still compute p_uuid_len.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>NRF_SUCCESS on successful read of the report, otherwise an error code. </dd></dl>

<p>Definition at line <a class="el" href="ble__uuid__util_8c_source.html#l00091">91</a> of file <a class="el" href="ble__uuid__util_8c_source.html">ble_uuid_util.c</a>.</p>

</div>
</div>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>


    <li class="footer">
      Copyright &copy 2006-2011 <a href="http://www.nordicsemi.no" style="text-decoration:none">Nordic Semiconductor</a>.
      All Rights Reserved.
      <a href="disclaimer.html">Disclaimer</a>
    </li>
   </ul>
 </div>


</body>
</html>
